import {defineConfig} from 'vite'
import {fileURLToPath, URL} from 'node:url'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    }
  },
  esbuild: {
    jsxFactory: 'h',
    jsxInject: `import {h} from '@/utils/jsx-runtime.ts'`,
  },
  build: {
    copyPublicDir: false,
    minify: true,
    lib: {
      entry: path.resolve(__dirname, './src/index.ts'),
      name: 'EasyDesign',
      fileName: 'easy-design',
    },
    rollupOptions: {
      output: {
        dir: 'dist'
      }
    }
  },
})
